<template>
  <!-- 全局注册组件 @click-right右边点击 -->
  <van-nav-bar
    class="hmNavBar"
    @click-left="$router.push(path)"
    @click-right="$emit('rightClick')"
  >
    <template #title>
      <div class="title">
        {{ title }}
      </div>
    </template>
    <!-- 有传路径才显示 -->
    <template #left v-if="path">
      <i class="iconfont f44">&#xe637;</i>
    </template>
    <template #right>
      <!-- right有值才显示 -->
      <div class="right" v-if="right">{{ right }}</div>
    </template>
  </van-nav-bar>
</template>
<script>
export default {
  name: 'hmNavBar',
  props: ['title', 'path', 'right'],
  data () {
    return {}
  }
}
</script>
<style lang="less" scoped>
.hmNavBar {
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: left;
    color: #222222;
    line-height: 25px;
    letter-spacing: 0px;
  }
  .f44 {
    font-size: 40px;
  }
  ::v-deep .van-nav-bar__left,
  ::v-deep .van-nav-bar__right {
    padding: 0;
  }
  .right {
    padding-right: @p15;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
}
</style>
